package com.zt.chatglm.session;

import com.zt.chatglm.domain.chat.ChatCompletionRequest;
import com.zt.chatglm.domain.chat.ChatCompletionSyncResponse;
import com.zt.chatglm.domain.image.ImageCompletionRequest;
import com.zt.chatglm.domain.image.ImageCompletionResponse;
import okhttp3.sse.EventSource;
import okhttp3.sse.EventSourceListener;

import java.util.concurrent.CompletableFuture;

/**
 * @author: zt
 * @Description: 会话服务接口
 * @create: 2024-05-20 23:40
 */

public interface OpenAiSession {

    EventSource completions (ChatCompletionRequest completionRequest, EventSourceListener eventSourceListener) throws Exception;

    CompletableFuture<String> completions (ChatCompletionRequest completionRequest) throws Exception;

    ChatCompletionSyncResponse completionsSync (ChatCompletionRequest completionRequest) throws Exception;

    ImageCompletionResponse genImages (ImageCompletionRequest request) throws Exception;

    Configuration getConfiguration();
}
